#include<malloc.h>
#include<stdlib.h>
#include<string.h>
#include<list>
#include"gc.h"


SimpleGc::SimpleGc(SecdVM *vm){
    this->vm = vm;
    this->mempool = new std::list<Value *>();
    this->NIL = (Value *)calloc(1,sizeof(Value));
    this->NIL->t = T_Nil;
}
SimpleGc::~SimpleGc(){
    delete this->mempool;
    free(this->NIL);
}

Value *SimpleGc::malloc(size_t valsize){
    Value *val = (Value *)calloc(1,valsize);
    val->mark = 0;
    this->mempool->push_back(val);
    return val;
}

void SimpleGc::mark(){}
void SimpleGc::markAll(){}
void SimpleGc::sweep(){}


